package com.bosssoft.cloud.wechat.core.bean.menu;


import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

/**
 * menu bean 调用wx menu api时的传参
 *
 * @author wcy create on 2021/7/7 10:27 上午
 */

@Data
public class WxMenuInfo implements Serializable {
    private static final long serialVersionUID = -81203094124202901L;
    @JSONField(name = "button")
    private List<WxMenuButton> buttons;

    @Data
    public static class WxMenuButton implements Serializable {
        private static final long serialVersionUID = -4426602953309048341L;
        @JSONField(name = "type")
        private String type;
        @JSONField(name = "name")
        private String name;
        @JSONField(name = "key")
        private String key;
        @JSONField(name = "url")
        private String url;
        @JSONField(name = "value")
        private String value;
        @JSONField(name = "appid")
        private String appId;
        @JSONField(name = "pagepath")
        private String pagePath;
        @JSONField(name = "sub_button")
        private List<WxMenuButton> subButtons;
        @JSONField(name = "news_info")
        private NewsInfo newsInfo;

        @Data
        public static class NewsInfo implements Serializable {
            private static final long serialVersionUID = 3449813746347818457L;
            @JSONField(name = "list")
            private List<NewsInButton> news;

            @Data
            public static class NewsInButton implements Serializable {
                private static final long serialVersionUID = 8701455967664912972L;
                @JSONField(name = "title")
                private String title;
                @JSONField(name = "digest")
                private String digest;
                @JSONField(name = "author")
                private String author;
                @JSONField(name = "show_cover")
                private Integer showCover;
                @JSONField(name = "cover_url")
                private String coverUrl;
                @JSONField(name = "content_url")
                private String contentUrl;
                @JSONField(name = "source_url")
                private String sourceUrl;
            }

        }

    }
}